package com.animals.dog.dogController;

import com.animals.dog.dogService.CatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@RestController
@RequestMapping("/dog")
public class MyDogController {

  @Autowired
  CatClient catClient;

  private final Logger logger = LoggerFactory.getLogger(getClass());

  @RequestMapping(value = "/add", method = RequestMethod.GET)
  public Integer add() {
    logger.info("dog add start!!");
    return catClient.add(10, 20);
  }

  @RequestMapping(value = "/testpost", method = RequestMethod.POST)
  public String testPost(@RequestBody String a) {
    logger.info("dog testpost start!!");
    return catClient.testPost(a);
  }



}
